%{

#ifdef MSVC
#define  isatty _isatty  // for some reason isatty is called _isatty in VC..
#endif

// Forward references for include files
class TreeNode;
class SymDesc;

#define  _LEX_CPP_   // make sure our variables get created
#include "lex.h"
#include "yacc.h"
#include <stdlib.h>
extern "C" int yywrap ();
void parsenumber();
%}
%%
"#"([a-zA-Z0-9]+"."?)+	{return VAR;}
([a-zA-Z]+[0-9]*)("."[a-zA-Z0-9]+)*	{return VAR;}
[0-9]+"."?([0-9])*	{parsenumber();return NUM;}
"=="	{return EQUAL;}
"!"		{return NOT;}
"&&"	{return AND;}
"||"	{return OR;}
\n       {lineno++;}  
"+"		{return ADD;}
"-"		{return SUB;}
"*"		{return MUL;}
"/"		{return DIV;}
"^"		{return POW;}
.	{return ERROR_TOKEN;}
%%
void parsenumber(){
yylval.num=atof(yytext);
}